﻿using StoreAppLibDemo.Examples.Animations;
using StoreAppLibDemo.Examples.Controls;
using StoreAppLibDemo.Examples.Converter;
using StoreAppLibDemo.Examples.Graph;
using StoreAppLibDemo.Examples.Settings;
using StoreAppLibDemo.Model;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace StoreAppLibDemo.ViewModel
{
    public class MainPageView
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="MainPageView"/> class"
        /// </summary>
        public MainPageView()
        {
            ObservableCollection<Library> libraries = new ObservableCollection<Library>();

            libraries.Add(new Library() { Group = "Controls", Name = "Pie Chart", View = typeof(PieChartPage), Image = "Assets/PieChart.png", Description = "Represents a Windows 8 Store Application pie chart control" });
            libraries.Add(new Library() { Group = "Controls", Name = "Arc Path", View = typeof(ArcPage), Image = "Assets/Arc.png", Description = "Represents a path to draw arch by specifying start and end angle in degrees" });
            libraries.Add(new Library() { Group = "Controls", Name = "Date Picker", View = typeof(DatePickerPage), Image = "Assets/DatePicker.png", Description = "Represents a Windows 8 Store Application control that allows the user to select a date and to display the date with a specified format" });
            libraries.Add(new Library() { Group = "Controls", Name = "Time Picker", View = typeof(TimePickerPage), Image = "Assets/TimePicker.png", Description = "Represents a Windows 8 Store Application control that allows the user to select a time and to display the time with a specified format" });
            libraries.Add(new Library() { Group = "Controls", Name = "Appbar Button", View = typeof(AppBarButtonPage), Image = "Assets/AppBarMenu.png", Description = "Represents a Windows 8 Store Application AppBar button with an option to create popup menu" });
            libraries.Add(new Library() { Group = "Controls", Name = "Page Header", View = typeof(PageHeaderPage), Image = "Assets/PageHeader.png", Description = "Represents a Windows 8 Store Application page header with global navigation menu" });

            libraries.Add(new Library() { Group = "Settings", Name = "Charm Setting", View = typeof(CharmSettingsPage), Image = "Assets/CharmSetting.png", Description = "CharmSetting Helps to configure any User control as charm setting with single line of code" });

            libraries.Add(new Library() { Group = "Effects", Name = "Tap Effect", View = typeof(TapEffectPage), Image = "Assets/TapEffect.png", Description = "Tap Effect is an attached property to apply pointer up/down theme animation when user tap on any UI Element" });

            libraries.Add(new Library() { Group = "Converters", Name = "Concatenation Converter", View = typeof(ConcatenationConverterPage), Image = "Assets/Converter.png", Description = "ConcatenationConverter concatenate a string property of all element in a collection during data binding using specified separator string" });
            libraries.Add(new Library() { Group = "Converters", Name = "Count Converter", View=typeof(CountConverterPage), Image = "Assets/Converter.png", Description = "CountConverter retrieves the count of elements in a collection during data binding" });
            libraries.Add(new Library() { Group = "Converters", Name = "Solid Color Brush Converter", View=typeof(SolidColorBrushConverterPage), Image = "Assets/Converter.png", Description = "SolidColorBrush converts a hexadecimal value or RGB value into SolidColorBrush during data binding" });
            libraries.Add(new Library() { Group = "Converters", Name = "Date Time Converter", View = typeof(DateTimeConvertPage), Image = "Assets/Converter.png", Description = "DateTimeConverter converts a DateTime value during data binding using specified format string" });

            this.Libraries = libraries;
        }

        /// <summary>
        /// Gets or sets the libraries.
        /// </summary>
        /// <value>
        /// The libraries.
        /// </value>			
        public ObservableCollection<Library> Libraries { get; set; }

        public IEnumerable<IGrouping<string, Library>> LibraryGroup
        {
            get
            {
                return from library in this.Libraries group library by library.Group into libraryGroup select libraryGroup;
            }
        }
    }
}
